package pf2.pdd.uea;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;


/** @author fernando | 13/09/2013 | 01:08:35
 * ProjetoFinal2 | pf2.pdd.uea | CadastroPacienteActivity.java :: Copyleft :: 2013. */

public class CadastroPacienteActivity extends MainActivity {

	//Definindo constante p ser utilizada nos Logs	
	private static final String CATEGORY = "projeto";

	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
		finish();
	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		finish();
	}


	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// TODO Auto-generated method stub
		return super.onCreateOptionsMenu(menu);
	}


	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		//Para este botão, preciso armazenar os dados dos EditText (nom_pac e tel_pac)
		super.onClick(v);
		Toast.makeText(this, "Paciente Cadastrado.", Toast.LENGTH_LONG).show();
		//Aqui deve ficar a rotina de salvar no BDsqlite...
		Intent it_sup = new Intent(this, MainActivity.class);
		startActivity(it_sup);
		
	}

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_paciente);		
		
		//Definindo as views da tela... (os TextView não são usados)
		EditText nom_pac = (EditText) findViewById(R.id.edt_nom_pac);
		EditText tel_pac = (EditText) findViewById(R.id.edt_tel_pac);
		Button save_pac  = (Button) findViewById(R.id.btn_armaz_pac);
		
		//Evento de click..
		save_pac.setOnClickListener(this);
	}
	
}
	

	


